<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%String path = request.getContextPath() ;%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %> 
<%@ taglib uri="/WEB-INF/tld/ui.tld" prefix="ui" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
 <meta name="renderer" content="webkit">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>收益分析信息</title>
<jsp:include page="../../import.jsp" flush="true" />
</head>
<body class="iframeBody">
 <div class="Wrapper">
   <div class="pageIn2layout">
<jsp:include page="../../project/prjbscinfo/prjInvestRpt.jsp" flush="true" >
		<jsp:param name="currentNav" value="prjcstprofitana"/>
</jsp:include>
<div class="pageIn2L_mid">
        <div>
           <div id="pageInTab" class="pageInTab">
                    <form id="prj_cst_profit_ana_form">
                        <div class="fieldset1 tabel_col clearFix">
		                      <div class="fieldBox col_33">
				                    <div class="label">拟运营线路</div>
				                    <div class="field">
				                        <input name="drftOptLine"  id="drftOptLine" type="text" class="ui-textbox" value="${profit.drftOptLine }">
				                 		  <span class="requiredSymbol">*</span>
				                    </div>
		               		 </div>
		               		  <div class="fieldBox col_33">
				                    <div class="label">拟运营距离（千米）</div>
				                    <div class="field">
				                        <input name="drftOptDist"  id="drftOptDist" type="text" class="ui-textbox" value="${profit.drftOptDist }">
				                    <span class="requiredSymbol">*</span>
				                    </div>
		               		 </div>
		               		   <div class="fieldBox col_33">
				                    <div class="label">月往返趟数（趟）</div>
				                    <div class="field">
				                        <input name="monRoundTm"  id="monRoundTm" type="text" class="ui-textbox" value="${profit.monRoundTm }" >
				                      <span class="requiredSymbol">*</span>
				                    </div>
		               		 </div>
		               		  <div class="fieldBox col_33">
				                    <div class="label">结算周期</div>
				                    <div class="field">
				                        <input name="settCyl"  id="settCyl" type="text" class="ui-textbox" value="${profit.settCyl }">
				                    <span class="requiredSymbol">*</span>
				                    </div>
		               		 </div>
		               		  <div class="fieldBox col_33">
				                    <div class="label">运输货物-去程</div>
				                    <div class="field">
				                        <input name="shpmetToDist"  id="shpmetToDist" type="text" class="ui-textbox" value="${profit.shpmetToDist }">
				                     <span class="requiredSymbol">*</span>
				                    </div>
		               		 </div>
		               		  <div class="fieldBox col_33">
				                    <div class="label">运输货物-回程</div>
				                    <div class="field">
				                        <input name="shpmetCmDist"  id="shpmetCmDist" type="text" class="ui-textbox" value="${profit.shpmetCmDist }" >
				                     <span class="requiredSymbol">*</span>
				                    </div>
		               		 </div>
		               		   <div class="fieldBox col_33">
				                    <div class="label">载重量（吨）-去程</div>
				                    <div class="field">
				                        <input name="loadWegtToDist"  id="loadWegtToDist" type="text" class="ui-textbox" value="${profit.loadWegtToDist }">
				                     <span class="requiredSymbol">*</span>
				                    </div>
		               		 </div>
		               		  <div class="fieldBox col_33">
				                    <div class="label">载重量（吨）-回程</div>
				                    <div class="field">
				                        <input name="loadWegtCmDist"  id="loadWegtCmDist" type="text" class="ui-textbox" value="${profit.loadWegtCmDist }" >
				                    <span class="requiredSymbol">*</span>
				                    </div>
		               		 </div>
		               		   <div class="fieldBox col_33">
				                    <div class="label">运费水平（元）-去程</div>
				                    <div class="field">
				                        <input name="frgtLvlToDist"  id="frgtLvlToDist" type="text" class="ui-textbox" value="${profit.frgtLvlToDist }">
				                    <span class="requiredSymbol">*</span>
				                    </div>
		               		 </div>
		               		   <div class="fieldBox col_33">
				                    <div class="label">运费水平（元）-回程</div>
				                    <div class="field">
				                        <input name="frgtLvlCmDist"  id="frgtLvlCmDist" type="text" class="ui-textbox" value="${profit.frgtLvlCmDist }">
				                    <span class="requiredSymbol">*</span>
				                    </div>
		               		 </div>
		               		   <div class="fieldBox col_33">
				                    <div class="label">司机工资（元）</div>
				                    <div class="field">
				                        <input name="drvrWage"  id="drvrWage" type="text" class="ui-textbox" value="${profit.drvrWage }">
				                     <span class="requiredSymbol">*</span>
				                    </div>
		               		 </div>
		               		  <div class="fieldBox col_33">
				                    <div class="label">过路过桥费（元）</div>
				                    <div class="field">
				                        <input name="toll"  id="toll" type="text" class="ui-textbox" value="${profit.toll }">
				                     <span class="requiredSymbol">*</span>
				                    </div>
		               		 </div>
		               		   <div class="fieldBox col_33">
				                    <div class="label">燃油费（元）</div>
				                    <div class="field">
				                        <input name="fuelCost"  id="fuelCost" type="text" class="ui-textbox" value="${profit.fuelCost }">
				                   <span class="requiredSymbol">*</span>
				                    </div>
		               		 </div>
		               		    <div class="fieldBox col_33">
				                    <div class="label"> 月保险费（元）</div>
				                    <div class="field">
				                        <input name="monPrem"  id="monPrem" type="text" class="ui-textbox" value="${profit.monPrem }">
				                      <span class="requiredSymbol">*</span>
				                    </div>
		               		 </div>
		               		    <div class="fieldBox col_33">
				                    <div class="label"> 维修保养费用（元）</div>
				                    <div class="field">
				                        <input name="maintCost"  id="maintCost" type="text" class="ui-textbox" value="${profit.maintCost }">
				                      <span class="requiredSymbol">*</span>
				                    </div>
		               		 </div>
		               		   <div class="fieldBox col_33">
				                    <div class="label"> 其他费用名称及金额（元）</div>
				                    <div class="field">
				                        <input name="othCost"  id="othCost" type="text" class="ui-textbox" value="${profit.othCost }">
				                      <span class="requiredSymbol">*</span>
				                    </div>
		               		 </div>
		               		   <div class="fieldBox col_33">
				                    <div class="label">  月净收入（元）</div>
				                    <div class="field">
				                        <input name="monNetIncm"  id="monNetIncm" type="text" class="ui-textbox" value="${profit.monNetIncm }">
				                      <span class="requiredSymbol">*</span>
				                    </div>
		               		 </div>
		               		    <div class="fieldBox col_33">
				                    <div class="label"> 月收入合计（元）</div>
				                    <div class="field">
				                        <input name="totalMonIncm"  id="totalMonIncm" type="text" class="ui-textbox" value="${profit.totalMonIncm }" >
				                     <span class="requiredSymbol">*</span>
				                    </div>
		               		 </div>
		               		 
		               		  <div class="fieldBox col_33">
				                    <div class="label"> 同业人员类比月收入(元)</div>
				                    <div class="field">
				                        <input name="analMonIncm"  id="analMonIncm" type="text" class="ui-textbox" value="${profit.analMonIncm }" >
				                     <span class="requiredSymbol">*</span>
				                    </div>
		               		 </div>
		               		 
		               		   <div class="fieldBox col_33">
				                    <div class="label">  月支出合计（元）</div>
				                    <div class="field">
				                        <input name="totalMonExpdtr"  id="totalMonExpdtr" type="text" class="ui-textbox" value="${profit.totalMonExpdtr }">
				                    <span class="requiredSymbol">*</span>
				                    </div>
		               		 </div>
		               		 <div class="fieldBox col_33">
				                    <div class="label"> 月均还款金额（元）</div>
				                    <div class="field">
				                        <input name="monRpmtAmt"  id="monRpmtAmt" type="text" class="ui-textbox" value="${profit.monRpmtAmt }">
				                     <span class="requiredSymbol">*</span>
				                    </div>
		               		 </div>
		               		  <div class="fieldBox col_33">
				                    <div class="label"> 每月收入支出比例</div>
				                    <div class="field">
				                        <input name="monIncmExpdtrRatio"  id="monIncmExpdtrRatio" type="text" class="ui-textbox" value="${profit.monIncmExpdtrRatio }" data-tofix="2">
				                    <span class="requiredSymbol">*</span>
				                    </div>
		               		 </div>
		               		  <div class="fieldBox col_100">
				                    <div class="label">当地行业现状分析</div>
				                    <div class="field">
				                        <input name="localInduAnal"  id="localInduAnal" type="text" class="ui-textbox" value="${profit.localInduAnal }">
				                      <span class="requiredSymbol">*</span>
				                    </div>
		               		 </div>
		               		   <div class="fieldBox col_100">
				                    <div class="label">设备运营环境简要描述</div>
				                    <div class="field">
				                        <input name="equipOptBrifDesc"  id="equipOptBrifDesc" type="text" class="ui-textbox" value="${profit.equipOptBrifDesc }">
				                     <span class="requiredSymbol">*</span>
				                    </div>
		               		 </div>
		               		   <div class="fieldBox col_100">
				                    <div class="label">路政执法情况简述</div>
				                    <div class="field">
				                        <input name="hgwyLowEfmtDesc"  id="hgwyLowEfmtDesc" type="text" class="ui-textbox" value="${profit.hgwyLowEfmtDesc }">
				                  <span class="requiredSymbol">*</span>
				                    </div>
		               		 </div>
		               		  <div class="fieldBox col_100">
				                    <div class="label">还款来源与保障</div>
				                    <div class="field">
				                        <input name="rymtSourGuar"  id="rymtSourGuar" type="text" class="ui-textbox" value="${profit.rymtSourGuar }">
				                      <span class="requiredSymbol">*</span>
				                    </div>
		               		 </div>
		               		 <div class="fieldBox col_100">
				                    <div class="label">风险控制措施</div>
				                    <div class="field">
				                        <input name="riskCtlMeas"  id="riskCtlMeas" type="text" class="ui-textbox" value="${profit.riskCtlMeas }">
				                     <span class="requiredSymbol">*</span>
				                    </div>
		               		 </div>
		               		  <div class="fieldBox col_50">
				                    <div class="label">是否有犯罪记录或诉讼案件</div>
				                    <div class="field">
				                     <select name="isCrimRecd"  id="isCrimRecd"   >
				                      <c:forEach items="${YesNoList}" var="opt">
		                                 <option value="${opt.key}"
		                                 <c:if test="${opt.key==abi.isCrimRecd }">selected="selected"</c:if>
		                                 >${opt.value}</option>
	                                </c:forEach>
	                                </select>
				                    </div>
		               		 </div>
		               		  <div class="fieldBox col_50">
				                    <div class="label">是否曾经被金融机构执行资产</div>
				                    <div class="field">
				                      <select name="isFinaInstAss"  id="isFinaInstAss"   >
				                     <c:forEach items="${YesNoList}" var="opt">
		                                 <option value="${opt.key}"
		                                 <c:if test="${opt.key==abi.isFinaInstAss }">selected="selected"</c:if>
		                                 >${opt.value}</option>
	                                </c:forEach>
	                                </select>
				                    </div>
		               		 </div>
                                <div class="fieldBox col_50">
                                <div class="label"  id="apyCrdtCdLable">申请企业我司信用记录</div>
                                <div class="field">
                                 <select name="apyCrdtCd"  id="apyCrdtCd"   >
	                                <c:forEach items="${keyList}" var="opt">
	                                 <option value="${opt.key}"
	                                 <c:if test="${opt.key==abi.apyCrdtCd }">selected="selected"</c:if>
	                                 >${opt.value}</option>
	                                </c:forEach>
	                                </select>
                                </div>
                            </div>
                            <div class="fieldBox col_50"  id="corpReprCrdtCdDiv" style="display: none">
                                <div class="label"> 法人代表我司信用记录</div>
                                <div class="field">
                                 <select name="corpReprCrdtCd"  id="corpReprCrdtCd"   >
	                                <c:forEach items="${keyList}" var="opt">
	                                 <option value="${opt.key}"
	                                 <c:if test="${opt.key==abi.corpReprCrdtCd }">selected="selected"</c:if>
	                                 >${opt.value}</option>
	                                </c:forEach>
	                                </select>
                                </div>
                            </div>
                              <div class="fieldBox col_50"  style="display: none">
                                <div class="field"> 
                              		<input name="profitId" id="profitId" type="text"  value="${profit.id }" >
                                </div>
                            </div>
                            </div>
                    </form>
                    </div>
                     <div class="btnsBox">
				                <span id="prj_cst_profit_ana_add_btn_id" class="sq-button sq-button-round" onclick="save();"><!-- <i class="sqBtnIco_10"></i> -->保存</span>
           				 </div>
                 </div>
            </div>
	</div>
	</div>

<script type="text/javascript">
 var prjId = '${prjId}';
var cstId = '${cstId}';
var cstType = '${cstType}';
var detailFlag = '${detailFlag}'; 
var cstRlCd  = '${cstRlCd}';
$(function () {
	initData();
	if(detailFlag =="true"){
		$("#prj_cst_profit_ana_add_btn_id").hide();
		if($("#drftOptLine")){
			$("#drftOptLine	").attr("readonly","readonly");
		}
		if($("#drftOptDist")){
			$("#drftOptDist").attr("readonly","readonly");
		}
		if($("#monRoundTm")){
			$("#monRoundTm").attr("readonly","readonly");
		}
		if($("#settCyl")){
			$("#settCyl").attr("readonly","readonly");
		}
		if($("#shpmetToDist")){
			$("#shpmetToDist	").attr("readonly","readonly");
		}
		if($("#equipOptBrifDesc")){
			$("#equipOptBrifDesc	").attr("readonly","readonly");
		}
		
		if($("#shpmetCmDist")){
			$("#shpmetCmDist").attr("readonly","readonly");
		}
		if($("#loadWegtToDist")){
			$("#loadWegtToDist").attr("readonly","readonly");
		}
		if($("#loadWegtCmDist")){
			$("#loadWegtCmDist").attr("readonly","readonly");
		}
		if($("#frgtLvlToDist")){
			$("#frgtLvlToDist").attr("readonly","readonly");
		}
		if($("#frgtLvlCmDist")){
			$("#frgtLvlCmDist").attr("readonly","readonly");
		}
		if($("#drvrWage")){
			$("#drvrWage").attr("readonly","readonly");
		}
		if($("#toll")){
			$("#toll").attr("readonly","readonly");
		}
		if($("#fuelCost")){
			$("#fuelCost").attr("readonly","readonly");
		}
		if($("#monPrem")){
			$("#monPrem").attr("readonly","readonly");
		}
		if($("#maintCost")){
			$("#maintCost").attr("readonly","readonly");
		}
		if($("#othCost")){
			$("#othCost").attr("readonly","readonly");
		}
		if($("#monNetIncm")){
			$("#monNetIncm").attr("readonly","readonly");
		}
		if($("#totalMonIncm")){
			$("#totalMonIncm").attr("readonly","readonly");
		}
		if($("#totalMonExpdtr")){
			$("#totalMonExpdtr").attr("readonly","readonly");
		}
		if($("#monRpmtAmt")){
			$("#monRpmtAmt").attr("readonly","readonly");
		}
		if($("#monIncmExpdtrRatio")){
			$("#monIncmExpdtrRatio").attr("readonly","readonly");
		}
		if($("#localInduAnal")){
			$("#localInduAnal").attr("readonly","readonly");
		}
		if($("#localInduAnal")){
			$("#localInduAnal").attr("readonly","readonly");
		}
		if($("#hgwyLowEfmtDesc")){
			$("#hgwyLowEfmtDesc").attr("readonly","readonly");
		}
		if($("#rymtSourGuar")){
			$("#rymtSourGuar").attr("readonly","readonly");
		}
		if($("#riskCtlMeas")){
			$("#riskCtlMeas").attr("readonly","readonly");
		}
		
		if(liger.get("isCrimRecd")){
			  liger.get("isCrimRecd").setDisabled(true);
		}
		if(liger.get("isFinaInstAss")){
			  liger.get("isFinaInstAss").setDisabled(true);
		}
		if(liger.get("apyCrdtCd")){
			  liger.get("apyCrdtCd").setDisabled(true);
		}
		if(liger.get("corpReprCrdtCd")){
			  liger.get("corpReprCrdtCd").setDisabled(true);
		}
	}
});

	//初始化数据
	function initData(){
		$("#prj_cst_profit_ana_form").ligerForm({
		    validate: true
		});
		if(cstType==ProjectConstant.CST_TYP_CD_NP){
			//自然人
			$("#apyCrdtCdLable").text("申请人我司信用记录");
		}
	if(cstType==ProjectConstant.CST_TYP_CD_LP){
			//法人
			$("#corpReprCrdtCdDiv").show();
		}
	}
	
	function save(){
        var ligerForm = liger.get("prj_cst_profit_ana_form");
        if (!ligerForm.valid()) {
            top.$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO,SQ_type: "warning"});
            return false; //验证不通过，不执行以下代码
        }
        var data = ligerForm.getData();
        var url = '<%=path%>/project/prjcstprofitana/add.do';
        var profitId = $("#profitId").val();
        data["id"]= profitId;
        data["prjId"]= prjId;
        data["cstId"]= cstId;
        data["cstRlCd"] = ProjectConstant.CST_RL_CST;
        var wait_dialog;
        $.ajax({
    		type: 'post',
    		dataType:'json',
    		data:data,
    		url: url,
     		beforeSend: function(){
		          wait_dialog=$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING ,SQ_type: "waitting" });
		     },
    		success:function(msg){
    			 wait_dialog.close();
    			 if(msg.success == 1){
    				 $("#profitId").val(msg.data);
    				 top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "success"});
    			 }else{
    				 top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
    			 }
    		}
    	});
	}
    </script>
</body>
</html>